﻿package com.firewolf.spring.transaction.byxml;

import java.util.List;

/***
 * 批量买多次书的服务
 * @author liuxing
 *
 */
public class BatchBookShopService {
	
	private BookShopService bookShopService = null;
	
	public void setBookShopService(BookShopService bookShopService) {
		this.bookShopService = bookShopService;
	}
	
	/**
	 * 批量买书
	 * @param userName
	 * @param booksIds
	 */
	public void bacthBuyBooks(String userName,List<String> bookIds){
		for(String bookId : bookIds){
			/**这里调用了多个事务*/
			bookShopService.buyBook(bookId, userName);
		}
	}
}
